﻿function setComma(val) {
    val = val.toString();
    var len = val.length;
    var ret = "";
    for (var i = 0; i < len; i++) {

        if (i != 0 && i % 3 == 0) {
            ret = "," + ret;
        }

        var x = val.substring(val.length - 1, val.length);
        val = val.substring(0, val.length - 1);

        ret = x + ret;
    }

    return ret;
}

function GoUrl(val) {
    document.location.href = val;
}

String.prototype.replaceAll = function (o, r) {
    return this.split(o).join(r);
}

function GetShortUrl(val) {
    N.Send(val, function (r) {
        var r = eval("(" + r + ")");
        if (r.code == 200) {
            DelegateGetShortUrl(r.result.url);
        }
        else {
            DelegateGetShortUrl(null);
        }
    });
}

function DelegateGetShortUrl(val) {
}